/*
 * @Author: zehao.chen
 * @Date: 2022-07-30 19:22:45
 * @LastEditors: zehao.chen
 * @LastEditTime: 2022-09-03 15:11:03
 * @FilePath: /meeting-admin/src/api/meetingInfo.js
 * @Description:
 *
 */
import http from '@/utils/request'

/**
 * @description: 查询会议列表
 * @return {*}
 */

export const meetingInfoList = (pageNum, pageSize, data) => {
  return http.post(`/pc/meetingInfo/meetingInfoList?pageNum=${pageNum}&pageSize=${pageSize}`, data)
}

/**
 * @description: 查询日历会议列表
 * @return {*}
 */

export const meetingInfoCadenlarDay = (pageNum, pageSize, data) => {
  return http.post(`/pc/meetingInfo/meetingInfoCadenlar?pageNum=${pageNum}&pageSize=${pageSize}`, data)
}

/**
 * @description: 新建会议
 * @return {*}
 */
export const addMeeting = (data) => {
  return http.post(`/pc/meetingInfo/addMeeting`, data)
}


/**
 * @description: 删除会议
 * @return {*}
 */
export const updateDelFlagByMeetingIds = (data) => {
  return http.post(`/pc/meetingInfo/updateDelFlagByMeetingIds?meetingIds=${data}`)
}

/**
 * @description: 会议 - 基础信息
 * @return {*}
 */
export const basicInfo = (meetingId) => {
  return http.get(`/pc/meetingInfo/basicInfo/${meetingId}`)
}

/**
 * @description: 修改会议信息
 * @param {*} data
 * @return {*}
 */
export const addBasicInfo = (data) => {
  return http.post('/pc/meetingInfo/addBasicInfo', data)
}

/**
 * @description: 查询会议设置
 * @param {*} meetingId
 * @return {*}
 */
export const settingInfo = (meetingId) => {
  return http.get(`/pc/meetingInfo/settingInfo/${meetingId}`)
}

/**
 * @description: 保存会议设置
 * @return {*}
 */
export const saveBasicInfo = (data) => {
  return http.post('/pc/meetingInfo/meetingSet', data)
}


/**
 * @description: 查询会务人员
 * @return {*}
 */
export const meetingConference = () => {
  return http({
    method: 'GET',
    url: '/pc/meetingConference/conferenceList',
    params: { userName: '' }
  })
}

/**
 * @description: 查询防疫设置
 * @return {*}
 */
export const antiepidemic = (meetingId) => {
  return http({
    method: 'GET',
    url: `/pc/meetingInfo/antiepidemic/${meetingId}`,
  })
}

/**
 * @description: 保存防疫设置
 * @return {*}
 */
export const saveAntiepidemic = (data) => {
  return http.post('/pc/meetingInfo/antiepidemicSet', data)
}

/**
 * @description: 查询会议是否有草稿
 * @return {*}
 */
export const ifHaveDraft = () => {
  return http({
    method: 'GET',
    url: `/pc/meetingInfo/ifHaveDraft`,
  })
}


/**
 * @description: 查询日历信息
 * @return {*}
 */
export const calendarDisplay = (data) => {
  return http({
    method: 'POST',
    url: `/pc/meetingInfo/calendarDisplay`,
    data: data
  })
}


/**
 * @description: 会议签到数据统计
 * @return {*}
 */
export const signDataCount = (meetingId) => {
  return http({
    method: 'GET',
    url: `/pc/meetingPeople/signDataCount/${meetingId}`,
  })
}

/**
 * @description: 会议签到情况列表
 * @return {*}
 */
export const signPeopleList = (data) => {
  return http({
    method: 'POST',
    url: `/pc/meetingPeople/signPeopleList?pageSize=${data.pageSize}&pageNum=${data.pageNum}`,
    data
  })
}

/**
 * @description: 参会人员名单表列表
 * @return {*}
 */
export const meetingPeopleList = (data) => {
  return http({
    method: 'POST',
    url: `/pc/meetingPeople/list?pageSize=${data.pageSize}&pageNum=${data.pageNum}`,
    data
  })
}

// 导出签到列表
export const exportMeetingList = (data, config) => {
  return http({
    method: 'GET',
    url: `/pc/meetingPeople/export/${data.meetingId}`,
    responseType: 'arraybuffer',
  })
}

/**
 * @description: 删除参会人员
 * @return {*}
 */
export const updateDelFlagByPeopleIds = (peopleIds) => {
  return http({
    method: 'POST',
    url: `/pc/meetingPeople/updateDelFlagByPeopleIds?peopleIds=${peopleIds}`
  })
}

/**
 * @description: 模板下载
 * @return {*}
 */
export const downloadTemplate = () => {
  return http({
    method: 'POST',
    url: `/pc/arrange/template/peopleTemplateDownload`,
  })
}

/**
 * @description: 会议预览
 * @return {*}
 */
export const preview = (meetingId) => {
  return http({
    method: 'GET',
    url: `/pc/meetingInfo/preview/${meetingId}`,
  })
}

/**
 * @description: 新建子会议
 * @return {*}
 */
export const addChildMeeting = (data) => {
  return http({
    method: 'POST',
    url: `/pc/meetingInfo/addChildMeeting`,
    data
  })
}

export const signUpDetail = (data) => {
  return http({
    method: 'POST',
    url: `/pc/meetingPeople/signUpDetail?meetingId=${data.meetingId}&peopleId=${data.peopleId}`,
  })
}







